package game.editer.ui;

import hx.events.Event;

class BooleanInput extends BaseAttributeInput {
	var checkBox = new CheckBox();

	override function onInit() {
		super.onInit();
		this.addChild(checkBox);
		checkBox.addEventListener(Event.CHANGE, (e) -> {
			this.onAttributeChange(this);
		});
	}

	override function set_value(value:Dynamic):Dynamic {
		checkBox.selected = value;
		return super.set_value(value);
	}

	override function get_value():Dynamic {
		return checkBox.selected;
	}
}
